﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<kysec.RAL.EFToMySql.tb_message>>" %>
<%@ Import Namespace="kysec.RAL.EFToMySql" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc"%>
<%if(Model.Count == 0){ %> 
    <span style="text-align:center; color:Red; font-size:16px; margin:0px 20px 0px 0px;">没有任何留言信息……</span>
<%}else{ %>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"  onmouseout="changeback()">
  <tr>
    <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">类型</span></div></td>
    <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">主题</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">内容</span></div></td>
    <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">发表时间</span></div></td>
    <td width="12%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">是否回复</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">状态</span></div></td>
    <td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">操作</span></div></td>
  </tr>
    <% foreach (kysec.RAL.EFToMySql.tb_message item in Model)
       { %>
  <tr>
    <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19"><%string ClassifyStr = item.c_i_typeId == 0 ? "客户反馈" : "用户留言";%><%=ClassifyStr %></span></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center" ><a href="javascript:;" title="<%=item.c_vc_title %>">主题显示</a></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><a href="javascript:;" title="<%=item.c_ntx_content %>">内容显示</a></div></td>    
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"> <%= Html.Encode(item.c_dt_publishedTime.ToShortDateString()) %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if (bool.Parse(Html.Encode(item.c_b_isReplay).ToString())){%>已回复<%}else{%>待回复<%} %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if (bool.Parse(Html.Encode(item.c_b_isDelete).ToString())){%>已删除<%}else{%>未删除<%} %></div></td>
    <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><%if (!item.c_b_isDelete)
                                                                            {
                                                                                if (item.c_b_isReplay)
                                                                                {%>
    <a href="<%:kysec.CR.MyUrl.WebData.WEBURL  %>/Message/SearchReplayMsg?id=<%:kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_mId).ToString())  %>&type=<%:item.c_i_typeId %>" target="main">查看</a>&nbsp;|&nbsp;
        <a href="<%:kysec.CR.MyUrl.WebData.WEBURL  %>/Message/Delete?id=<%:kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_mId).ToString())  %>&type=<%:item.c_i_typeId %>" >删除</a></span>
                                                                                <%}
                                                                                else if (!item.c_b_isReplay)
                                                                                { %>
    <span class="del">
        <a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/Message/SearchMsg?id=<%:kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_mId).ToString())  %>&type=<%:item.c_i_typeId %>&isUpdate=1" target="main">回复</a> &nbsp;|&nbsp;
        <a href="<%:kysec.CR.MyUrl.WebData.WEBURL  %>/Message/SearchMsg?id=<%:kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_mId).ToString())  %>&type=<%:item.c_i_typeId %>&isUpdate=0" target="main">查看</a>&nbsp;|&nbsp;
        <a href="<%:kysec.CR.MyUrl.WebData.WEBURL  %>/Message/Delete?id=<%:kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_mId).ToString())  %>&type=<%:item.c_i_typeId %>">删除</a></span><%}}
                                                                                else
                                                                                { %><span class="restore"><a href="<%:kysec.CR.MyUrl.WebData.WEBURL  %>/Message/Delete?id=<%:kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_mId).ToString())  %>&type=<%:item.c_i_typeId %>">恢复</a></span><%
                                                                            } %></div></td>
  </tr> 
  <%} %>
</table>
<%} %>
<%=Html.AjaxPager(Model, new PagerOptions() { CssClass = "mvcPager", PageIndexParameterName = "id", ShowMorePagerItems = false, AlwaysShowFirstLastPageNumber = true, ShowPageIndexBox = true, PageIndexBoxWrapperFormatString = "页{0}" }, new AjaxOptions() { UpdateTargetId = "page" })%>

